<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    // console.log(localStorage)
    // console.log(window.localStorage)
    // console.log(window.localStorage === localStorage)

    // 增或改
    // localStorage.setItem("qwe", "hello");
    
    // localStorage.setItem("qwe", "world");

    // 删单条
    // localStorage.removeItem("qwe");

    // 查
    // console.log(localStorage.getItem("qwe"));
    
    // 删所有
    // localStorage.clear();

    // 查所有
    // console.log(localStorage);

    // 数据长度
    // console.log(localStorage.length);
    
    // =========

    // localStorage.abc = "hello";
    // localStorage.abc = "world";
    // delete localStorage.abc;
    // console.log(localStorage.abc);
    // console.log(localStorage);


    // ==========

    // sessionStorage.setItem("abc", "hello");

    // sessionStorage.setItem("a", "hello");
    // sessionStorage.setItem("b", 123);
    // sessionStorage.setItem("c", true);
    // sessionStorage.setItem("d", undefined);
    // sessionStorage.setItem("e", null);
    // sessionStorage.setItem("f", NaN);
    // sessionStorage.setItem("g", {});
    // sessionStorage.setItem("h", {name:"admin"});
    // sessionStorage.setItem("i", []);
    // sessionStorage.setItem("j", [4,5,6,7]);
    // sessionStorage.setItem("k", function(){});
    // sessionStorage.setItem("l", JSON.stringify({name:"admin"}));

    console.log(sessionStorage);

</script>
</html>